import random

"""
start north rotate clockwise
0 = out, circle
1 = out, square
2 = in, circle
3 = in, square
"""
peices = [
    [1,0,1,1],
    [0,2,3,2],
    [0,1,2,0],
    [3,1,2,0],
    [1,3,0,3],
    [0,0,1,1],
    [0,3,0,1],
    [2,0,0,1],
    [3,0,3,2]
    ]


connections = {
    0:[],
    1:[],
    2:[],
    3:[],
    4:[],
    5:[],
    6:[],
    7:[],
    8:[],
    9:[],
    10:[],
    11:[]
    }

# this function shuffles the values in peices and places them in slot
def rand_s(p):
    # the empty slot list stores a solution
    slot = []
    random.shuffle(p)
    for i in dictionary:
        slot[i] = p[i]
    return slot

# next there should be a function which checks to see if the value is valid
def check_s(stuff):
    while True:
        for i in stuff:
            for x in i:
                if x = 0 and (i+1)[x] = 2:
                    return True
                elif x = 1 and (i+1)[x] = 3:
                    return True
                elif x = 2 and (i+1)[x] = 0:
                    return True
                elif x = 3 and (i+1)[x] = 1:
                    return True
                else:
                    return False
    else:
        return False

print(check_s(rand_s(pieces)))